Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check metakg before query execution and cancel on missing operations #72

Merged
merged 3 commits into from
Nov 18, 2021

Conversation

tokebe
Copy link
Member

@tokebe tokebe commented Nov 11, 2021

(addresses biothings/biothings_explorer#335, new PR/branch re-created due to broken rebase)

Original PR here: #66

Query edges are iterated over and checked against the metakg to ensure there are SmartAPI edges that correspond. On each edge iteration, it is assumed that the edge returned results so that the next edge may be reversed as needed (should resolve #66 (comment)).

@colleenXu
Copy link
Contributor

Might want to check the automated tests for this repo, I think I see two failing...

@colleenXu
Copy link
Contributor

@tokebe I'm not sure that this code is actually working? It seems to stall after some step to iterate / generate mock queryEdges to check against the metaKG...

Example: it just seems to stall after this set of logs

  bte:biothings-explorer-trapi:main MetaKG successfully loaded! +34ms
  bte:biothings-explorer-trapi:query_graph (1) Creating edges for manager... +0ms
  bte:biothings-explorer-trapi:query_graph Creating node... +1ms
  bte:biothings-explorer-trapi:NewQNode (1) Node "n0" has (1) entities at start. +0ms
  bte:biothings-explorer-trapi:NewQNode (1) Node "n0" expanded initial curie. {"MONDO:0020763":["MONDO:0020763"]} +0ms
  bte:biothings-explorer-trapi:query_graph Creating node... +0ms
  bte:biothings-explorer-trapi:NewQNode (1) Node "n1" has (0) entities at start. +0ms
  bte:biothings-explorer-trapi:NewQNode "n0" connected to "e1" +1ms
  bte:biothings-explorer-trapi:NewQNode "n1" connected to "e1" +0ms
  bte:biothings-explorer-trapi:UpdatedExeEdge (2) Created Edge "e1" Reverse = false +0ms
  bte:biothings-explorer-trapi:main (3) All edges created {"0":[{"qEdge":{"id":"e1","subject":{"id":"n0","category":["biolink:Disease"],"curie":["MONDO:0020763"],"expanded_curie":{"MONDO:0020763":["MONDO:0020763"]},"entity_count":1,"held_curie":[],"held_expanded":{},"connected_to":{}},"object":{"id":"n1","category":["biolink:PhenotypicFeature"],"expanded_curie":{},"entity_count":0,"held_curie":[],"held_expanded":{},"connected_to":{}}},"reverse":false,"input_equivalent_identifiers":{},"output_equivalent_identifiers":{},"object":{"id":"n1","category":["biolink:PhenotypicFeature"],"expanded_curie":{},"entity_count":0,"held_curie":[],"held_expanded":{},"connected_to":{}},"subject":{"id":"n0","category":["biolink:Disease"],"curie":["MONDO:0020763"],"expanded_curie":{"MONDO:0020763":["MONDO:0020763"]},"entity_count":1,"held_curie":[],"held_expanded":{},"connected_to":{}},"executed":false,"logs":[],"results":[]}]} +2ms

@tokebe
Copy link
Member Author

tokebe commented Nov 15, 2021

@colleenXu It appears the stalling was caused by some missing imports, they must have been dropped while I was trying to fix the broken rebase. The latest commit should fix this.

@colleenXu
Copy link
Contributor

Works now. I suggest this for merging / deploying to prod ASAP

@colleenXu
Copy link
Contributor

@tokebe This PR will need resolving with main before merge though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants